package com.y.simple.controller;


import com.y.simple.bean.LoginBean;
import com.y.simple.global.Result;
import com.y.simple.service.IUserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author y2014188432
 * @since 2023-05-13
 */
@Tag(name = "用户登录控制类", description = "")
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private IUserService userService;

    @Tag(name = "登录校验", description = "返回token")
    @PostMapping("/login")
    private Result login(@RequestBody LoginBean dto) {
        return Result.success(userService.login(dto));
    }


}
